package cc.marcio.systems.seven.model;

import java.io.Serializable;

import javax.persistence.AssociationOverride;
import javax.persistence.AssociationOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

@Entity
@Table(name = "t_contact", uniqueConstraints = { @UniqueConstraint(columnNames = { "contactdom_id", "user_id" }) })

@AssociationOverrides( { 
	@AssociationOverride(name="id.user", joinColumns=@JoinColumn(name="user_id")),
	@AssociationOverride(name="id.contactdom", joinColumns=@JoinColumn(name="contactdom_id"))})
public class Contact implements Serializable {

	private static final long serialVersionUID = -5264208130451771259L;

	@EmbeddedId
	private ContactId id;
	
	@Column( nullable = false, unique = true, insertable = true, updatable = true )
	private String description;

	public ContactId getId() {
		return id;
	}

	public void setId(ContactId id) {
		this.id = id;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}
}